***HOW TO EDIT GALLETTO V48 FIRMWARE*** by zioweb

I created this guide starting from files and info taken on mhhauto.com and provided by another user.
The information I received was incomplete, so I studied a full solution and created this guide to help users on mhhauto.com.
I assume you have the HW/SW and knowledge on how to program the device. If not, take a look on the forum to how program an LPC2119 device.

First of all download and install a clean version of the v48 Software: https://mega.co.nz/#!OBFDhJBA!DghD7UyHRf4AYOqcFsZG-KnM9-rj3-y52XcAyAUIB2E

With this guide are provided TWO firmware files for example and comprehension.
To edit those files you need an HEX editor capable to export in "32 Bit Intel HEX" in order to load the firmware on the device.
I use HxD but you can use what you prefer.

The FGtech v48 SW needs that every device has its own firmware because must be customized with the serial of the FTDI controller.
Also, you have to put an identificative Tool Number, that is simply the ID of the device that you will see on the right when the FGTech program will start, something like "0048-103" where 0048 is the FW version and 103 is the TOOL ID. You can choose whatever ID you like.

Where to find the FTDI ID?
Connect your FGTech device to the computer (if you need to install the driver for the device, use the one inside the v48 SW folder).
Copy the License Tool (lictool.exe) in the V48 SW folder and start it. Click on "GetChipId" to view the FTDI ID.

Example files: one is customized for the FTDI ID "AABBCCDD" and Tool ID "081", the other for FTDI ID "A1B1C1D1" and Tool ID "402", you can compare both files to see the difference between the two files.

Let's see inside the files.
In address 4C28 4C29 4C30 4C31 we have the FTDI ID in backwords from two and two bytes directly in HEX value.
How to edit this information? Well, compare the two files provided will give you a clear idea, but to be more specific you have to edit as follow.
Eg. if your FTDI ID is c1b45a22: bb aa dd cc
                                 b4 c1 22 5a

Same situation, but with another order, at B1F3 B1F4 B1F5 B1F6, you have to edit in HEX and put you FTDI ID.

In address B1F0 B1F1 B1F2 we found the Tool ID backwords written clear in the "TEXT ASCII side of the editor", edit this if you like to change your Tool ID.
In B26E we have to put the "middle" number of the Tool ID we want. So if we and to use Tool ID 458 we have to put "5".

In B348 and B349 we have again Tool ID backword but this time the ID is written directly in HEX.
Finally in CE22 and CE23 there is the Tool ID straight in HEX.

After you change those information in the file, you have to export in "32 BIT Intel HEX" and write on the device.

When the device wil be ready is time to generate the license and write it in the FTDI chip (same as "usbfix" but from scratch).
Is important you use a clean SW because china versions use modified DLL and the lictool will not work.

Open lictool.exe, inside we found:

"cid" is the FTDI ID
"chk" is the checksum wich is generated
"mid" is the tool id number you choose (same as one in the FW of course)
"date1" is the date that tool will expire" put 01/01/2020
"date2 and 3" means the date that software was last executed (not important, put the date of today)
"master/slave" you should put same number like in "mid" for master tool

CID will be automatically populated if you click "GetChipID", insert other information, click on "CalcChecksum" and later on "WriteLicense".
After that you'll be ok and device will be ready.

Now you can start the SW and use your device.

Hint 1: after programming the device, I found sometimes that the lictool couldn't work due to an FTDI misprogrammed. Use an usbfix for the v48 to revive the device (I inserted a general file for 402 Tool ID) and later do the lictool process. In very stubborn situation, you can help yourself with FTDI official software, like mprog or ft_prog to edit the FTDI data.

Hint 2: when all is perfeclty running, use FTReadWrite to Read your FTDI and save for future needs.